<?php

if (!defined('BASEPATH'))
	exit('No direct script access allowed');

/**
 * Description of commoncall
 *

 */
class Email_template_model extends CI_Model {

	//put your code here

	function __construct() {
		parent::__construct();
		log_message('debug', 'Model Initialized');
	}

	function get_template() {
		if (!$this->db->table_exists('email_template')) {

			return FALSE;
		}
		$this->db->select('*')->from('email_template');
		$this->db->where('status', '51');
		$this->db->order_by('id');
		$query = $this->db->get();
		$result = $query->result();
		return $result;
	}

	
	
	function get_template_by_id($id=NULL) {
		if ($id) {
			$this->db->select('*')->from('email_template');
			$this->db->where('status', '51');
			$this->db->where('id', $id);
			$query = $this->db->get();
			$result = $query->row();
			return $result;
		}
	}

}